/**
 * Copyright ©2012-2018 HopeHaiyang Corporation, All Rights Reserved
 * http://www.wuhanhope.com
 */
package hope.platform.data.server.data.img;

import hope.platform.data.dao.DataTypeRepository;
import hope.platform.data.domain.DataType;
import hope.platform.data.server.data.header.DataTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * class info
 *
 * @author hujia
 *         Create at 2018/8/7 10:18
 */
@Service
public class DataTypeServiceImg implements DataTypeService {

    @Autowired
    private DataTypeRepository repository;

    @Override
    public DataType add(DataType dataType) {
        dataType.setGmtModified(new Date());
        dataType.setGmtCreate(new Date());
        return repository.save(dataType);
    }

    @Override
    public List<DataType> getAll() {
        return repository.findAll();
    }
}
